package model;

import java.sql.Date;
import java.util.List;

/**
 * This class creates the patient information. Mostly consists of
 * getters/setters as of now. Constructs the patient information class.
 * 
 * @author evelyn942
 * @version 1.0 3-10-11
 */

public class PatientInformation {

	private String name, address, phone, email, pharmacy, insurance, cellPhone,
			allergies;

	private Gender gender;

	private Date birthDate;

	/**
	 * This variable instantiates a medicalHistory. It will have the list of
	 * treatment records and medicalHistorys make up part of a patient's
	 * information along with all the other basic information.
	 */
	private final MedicalHistory medicalHistory;

	/**
	 * This constructor takes in no parameters and instantiates a new instance
	 * of medialHistory. This class will access Medical History to put in the
	 * patient information records.
	 */
	public PatientInformation() {
		medicalHistory = new MedicalHistory();
	}

	/**
	 * This method adds a TreatmentRecord to the medicalHistory array list
	 * instance. Accesses the addTreatmentRecord method in Medical History.
	 * 
	 * @param tr
	 *            This is a variable of type TreatmentRecord. added to the array
	 *            list of treatment records via the method addTreatmentRecord in
	 *            the medical history class
	 */
	public void addTreatmentRecord(TreatmentRecord tr) {
		medicalHistory.addTreatmentRecord(tr);
	}

	/**
	 * This toString method returns all the information from this class. It
	 * allows for access/storage from/to the database.
	 * 
	 * @return Returns a long string of information from this class for access
	 *         by all other classes and database.
	 */
	public String toString() {
		return "PATIENT INFORMATION/n Name" + this.getName() + "/n Address"
				+ this.getAddress() + "/n Phone" + this.getPhone() + "/n Email"
				+ this.getEmail() + "/n Pharmacy" + this.getPharmacy()
				+ "/n Insurance" + this.getInsurance() + "/n Cell Phone"
				+ this.getCellPhone() + "/n Allergies" + this.getAllergies()
				+ "/n Gender" + this.getGender() + "/n Date of Birth"
				+ this.getBirthDate();
	}

	/**
	 * This getter for the Name allows the user or database to access the name
	 * for the patient.
	 * 
	 * @return name Returns a string of the patient's name to be accessed by
	 *         users and other classes.
	 */
	public String getName() {
		return name;
	}

	/**
	 * Takes in a string to set the patients name. Will allow users to enter
	 * patient's names.
	 * 
	 * @param name
	 *            Takes in a string to set the patients name.
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * This getter for the address allows the user or database to access the
	 * address for the patient.
	 * 
	 * @return name Returns a string of the patient's address to be accessed by
	 *         users and other classes.
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * This setter takes in a string to set the patients address. It will allow
	 * users to set the patient's address.
	 * 
	 * @param address
	 *            Takes in a string to set the patient's address
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * This getter for the phone number allows the user or database to access
	 * the phone number for the patient.
	 * 
	 * @return name Returns a string of the patient's phone number to be
	 *         accessed by users and other classes.
	 */
	public String getPhone() {
		return phone;
	}

	/**
	 * This setter takes in a string to set the patient's phone number. It will
	 * allow users to set the patient's phone number and store in the database
	 * for later access.
	 * 
	 * @param phone
	 *            Takes in a string to set the patient's phone number.
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 * This getter for the email allows the user or database to access the email
	 * for the patient.
	 * 
	 * @return name Returns a string of the patient's email to be accessed by
	 *         users and other classes.
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * This setter takes in a string to set the patient's email. It will allow
	 * users to set the patient's email and store in the database for later
	 * access.
	 * 
	 * @param email
	 *            Takes in a string to set the patient's email.
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * This getter for the Pharmacy allows the user or database to access the
	 * Pharmacy for the patient.
	 * 
	 * @return returns the name of the pharmacy.
	 */
	public String getPharmacy() {
		return pharmacy;
	}

	/**
	 * This setter takes in a string to set the patient's Pharmacy. It will
	 * allow users to set the patient's Pharmacy and store in the database for
	 * later access.
	 * 
	 * @param pharmacy
	 *            Takes in a string to set the patient's Pharmacy.
	 */
	public void setPharmacy(String pharmacy) {
		this.pharmacy = pharmacy;
	}

	/**
	 * This getter for the insurance allows the user or database to access the
	 * insurance for the patient.
	 * 
	 * @return name Returns a string of the patient's insurance to be accessed
	 *         by users and other classes.
	 */
	public String getInsurance() {
		return insurance;
	}

	/**
	 * This setter takes in a string to set the patient's insurance. It will
	 * allow users to set the patient's insurance and store in the database for
	 * later access.
	 * 
	 * @param insurance
	 *            Takes in a string to set the patient's insurance.
	 */
	public void setInsurance(String insurance) {
		this.insurance = insurance;
	}

	/**
	 * This getter for the cell phone number allows the user or database to
	 * access the cell phone number for the patient.
	 * 
	 * @return name Returns a string of the patient's cell phone number to be
	 *         accessed by users and other classes.
	 */
	public String getCellPhone() {
		return cellPhone;
	}

	/**
	 * This setter takes in a string to set the patient's cell phone number. It
	 * will allow users to set the patient's cell phone number and store in the
	 * database for later access.
	 * 
	 * @param cellPhone
	 *            Takes in a string to set the patient's cell phone number.
	 */
	public void setCellPhone(String cellPhone) {
		this.cellPhone = cellPhone;
	}

	/**
	 * This getter for the gender allows the user or database to access the
	 * gender for the patient.
	 * 
	 * @return name Returns a string of the patient's gender to be accessed by
	 *         users and other classes.
	 */
	public Gender getGender() {
		return gender;
	}

	/**
	 * This setter takes in a string to set the patient's gender. It will allow
	 * users to set the patient's gender and store in the database for later
	 * access.
	 * 
	 * @param gender
	 *            Takes in a string to set the patient's gender.
	 */
	public void setGender(Gender gender) {
		this.gender = gender;
	}

	/**
	 * This getter for the DOB allows the user or database to access the DOB for
	 * the patient.
	 * 
	 * @return name Returns a string of the patient's DOB to be accessed by
	 *         users and other classes.
	 */
	public Date getBirthDate() {
		return birthDate;
	}

	/**
	 * This setter takes in a string to set the patient's DOB. It will allow
	 * users to set the patient's DOB and store in the database for later
	 * access.
	 * 
	 * @param birthDate
	 *            Takes in a string to set the patient's DOB.
	 */
	public void setBirthDate(Date birthDate) {
		this.birthDate = birthDate;
	}

	/**
	 * This getter for the allergies allows the user or database to access the
	 * allergies for the patient.
	 * 
	 * @return name Returns a string of the patient's allergies to be accessed
	 *         by users and other classes.
	 */
	public String getAllergies() {
		return allergies;
	}

	/**
	 * This setter takes in a string to set the patient's allergies. It will
	 * allow users to set the patient's allergies and store in the database for
	 * later access.
	 * 
	 * @param allergies
	 *            Takes in a string to set the patient's allergies.
	 */
	public void setAllergies(String allergies) {
		this.allergies = allergies;
	}

	/**
	 * This getter for the Medical History allows the user or database to access
	 * the Medical History for the patient.
	 * 
	 * @return name Returns an instance of the patient's Medical History to be
	 *         accessed by users and other classes.
	 */
	public MedicalHistory getMedicalHistory() {
		return medicalHistory;
	}

	/**
	 * This method gets the list of treatment records. It accesses the class
	 * medicalHistory's method of getTreatmentRecords.
	 * 
	 * @return Returns a list of treatment records for users or database to
	 *         access
	 */
	public List<TreatmentRecord> getTreatmentRecords() {
		return medicalHistory.getTreatmentRecords();
	}

	/**
	 * This method accesses medicalHistory's getNewestTreatment method to get
	 * the newest treatment record for a class.
	 * 
	 * @return Returns the newest treatment record for a patient for access for
	 *         database and users
	 */
	public TreatmentRecord getNewestTreatment() {
		return medicalHistory.getNewestTreatment();
	}
}